package com.sanbi.common.express.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @description: 菜鸟库存质量枚举
 * @author: wanpeng
 * @create: 2024-05-29 08:45
 * @Version 1.0
 **/
@AllArgsConstructor
@Getter
public enum CaiNiaoStockQualityEnum {
    G("G", "良好"),
    B("B", "破损"),
    R("R", "退件"),
    C("C", "违禁品"),
    W("W", "淋湿"),
    M("M", "霉变"),
    E("E", "异常");


    /** 编码 */
    private final String code;
    /** 描述 */
    private final String desc;

    public static CaiNiaoStockQualityEnum getByCode(String code) {
        for (CaiNiaoStockQualityEnum e : CaiNiaoStockQualityEnum.values()) {
            if (Objects.equals(e.getCode(), code)) {
                return e;
            }
        }
        return null;
    }

}


